$(function () {
    /*
    提交订单
     */
    $("#J_Go").click(function () {
        //获得地址id
        let addressId = $('li.defaultAddr').find(':hidden').val();

        //获得选中商品id
        let skuId = $("#skuId");
        let skuIdArr = "";
        skuId.each(function () {
            skuIdArr += $(this).val() + ",";
        })
        skuIdArr = skuIdArr.substring(0, skuIdArr.length - 1);
        //提交到服务器进行处理
        //获得订单金额
        var orderAmount = $("#J_ActualFee").text();
        $.get("http://localhost:8080/Shop_war_exploded/order/addOrder?addressId=" + addressId + "&skuId=" + skuIdArr + "&orderAmount=" + orderAmount, function (data) {
            // alert(data);
            //跳转到付款界面
            window.location.href="http://localhost:8080//Shop_war_exploded/pay/pay?orderId="+data+"&orderAmount="+orderAmount;
        })
    })
})